Column

Mapa

Column

Cifras

Gráfico

Tabla

---
title: "Parches esenciales e importantes para grupo funcional de bosque"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    social: menu
    source_code: embed
    vertical_layout: fill
---

```{r setup, include=FALSE}
#-------------------- Paquetes --------------------

library(flexdashboard)
library(plotly)
library(dplyr)
library(tidyr)
library(sf)
library(leaflet)
library(leaflet.esri)
library(leaflet.extras)
library(esri2sf)

#----------------------- URL ----------------------

url_agfs_parches <-
  paste0("https://services9.arcgis.com/RrvMEynxDB8hycVO/ArcGIS/rest/services/",
         "parches_esenciales_importantes_bosque_corredores/FeatureServer/0?token=umbDHiqWzA0uFDBIez41jSU7u6moRbokgIQwEBLbk6-kJm99mNZw6AFOTVYx7fPBj5SoatGC7oW2Prj97uaa36NmBUJ4U8KUk8qu2PilfsVWinOp-bDtuUCccx1Ge-uNNLUEF7I2N2eXIo8KW1-YgYm9Yy6P_pskbOhcUfFqEIs_RGPO_YDBEh7WBN_mYSReIi-Wbgvtv9VxXJLoQwxEmvfskVLCMPJdt15imyPHxnQfRtdCP0rMgVBYHICh-5iW"
  )

#---------------------- Datos ---------------------

# Objeto sf de parches (ESTO NO ESTÁ FUNCIONANDO)
sf_parches = esri2sf(url_agfs_parches)
```

Column {data-width=650}
-----------------------------------------------------------------------

### Mapa

```{r}
leaflet() %>%
  setView(-84, 9.95, 11) %>%
  addProviderTiles(providers$OpenStreetMap.Mapnik, group = "OpenStreetMap") %>%
  addProviderTiles(providers$Stamen, group = "Stamen") %>%
  addProviderTiles(providers$Esri.WorldImagery, group = "Imágenes de ESRI") %>%
  addEsriFeatureLayer(
    url = url_agfs_parches,
    color = "#013220",
    group = "Parches"
  ) %>%  
  addLayersControl(
    baseGroups = c("OpenStreetMap", "Stamen", "Imágenes de ESRI"),
    overlayGroups = c("Parches"),
    options = layersControlOptions(collapsed = TRUE)    
  ) %>%  
  addMiniMap(
    toggleDisplay = TRUE,
    position = "bottomleft",
    tiles = providers$OpenStreetMap.Mapnik
  ) %>%
  addScaleBar(
    position = "bottomright",
    options = scaleBarOptions(imperial = FALSE)
  )
```

Column {data-width=350}
-----------------------------------------------------------------------

### Cifras
```{r}
```

### Gráfico
```{r}
```

### Tabla
```{r}
```